package com.shiliao.framework;

import android.content.Context;
import android.os.Environment;

import java.io.File;

/**
 * Created by yx on 2017/6/5.
 */

public class FrameworkConfig {
    public final static String DEFAULT_FOLDER = "shiliao";

    public static boolean LogEnable = true;

    public static final String FILE_NAME = "shiliao_config";


    //控制是否打印log
    public static boolean getLogEnable() {
        return LogEnable;
    }

    public static void setLogEnable(boolean enable) {
        LogEnable = enable;
    }

    public static final String pmFolder = DEFAULT_FOLDER + File.separator;

    //app 的文件默认路径，需要存储权限
    public static final String appSdPath = Environment.getExternalStorageDirectory()
            + File.separator + pmFolder;

    //app 下载路径
    public static final String pmSDCardDownloadDir = appSdPath + "download";

    //app 日志路径
    public static final String pmLogDir = appSdPath + ".log";

    //app 图片下载路径
    public static final String pmImageDir = appSdPath + "image";

    //字体路径
    public static final String FONT_FOLDER = Environment.getExternalStorageDirectory().getAbsolutePath()
            + File.separator + pmFolder + "/fonts";

    //不需要存储权限的app私有空间,文件会随app卸载而清除
    public static File getAppFilePath(Context appContext) {
        File file = appContext.getExternalFilesDir(pmFolder);
        return file;
    }

}
